import { i18n } from '@/i18n'
import router from '@/router'
import { createBounceFixer } from '@varlet/bounce-fixer'
import { inMobile } from '@varlet/shared'
import dayjs from 'dayjs'
import { createPinia } from 'pinia'
import { createApp } from 'vue'
import App from './App.vue'
import { setupAppHeight } from './utils/elements'

import '@/styles/common.less'
import '@varlet/touch-emulator'
import 'virtual-icons'
import 'virtual:uno.css'

if (!inMobile() && window === window.parent) {
  // window.location.replace('./desktop.html')
  window.location.replace('/')
}

setupAppHeight()

createBounceFixer().enable()

const app = createApp(App)
//  
app.provide('icon', 'https://cdn-hterobot.oss-cn-qingdao.aliyuncs.com/JOY/kexuezhongxin/logo_kexuezhongxin.svg')
// 昌平区
app.provide('organizer', '昌平区')

app.config.globalProperties.$dayjs = dayjs

app.use(router).use(i18n).use(createPinia()).mount('#app')
